#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int x,y,dp[100010];
signed main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>x>>y;
	dp[x]=1;
	for(int i=x+1;i<=y;i++){
		dp[i]=dp[i-1];
		if(i%2==0) dp[i]+=dp[i/2],dp[i]%=mod;
	}
	cout<<dp[y];
	return 0;
}